class Student:
    format_title = "{:<10}{:<10}{:<10}{:<15}"
    format_data = "{:<11}{:<10}{:<11}{:<15}"
    def __init__(self,no,name,age,major):
        self.no = no
        self.name = name
        self.age = age
        self.major = major

    @classmethod
    def show_title(cls):
        print(cls.format_title.format("学号","姓名","年龄","专业"))

    def __str__(self):
        return Student.format_data.format(self.no,self.name,self.age,self.major)

if __name__ == '__main__':
    Student.show_title()
    stu = Student("001","张总",23,"物理信息")
    print(stu)
